home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir39 / cdpath12.zip / READ.ME < prev   
Text File  |  1993-08-07  |  8KB  |  198 lines

  1.  
  2.                              CDPATH.COM 
  3.                               KCD.COM
  4.  
  5.                             Version 1.2
  6.  
  7.                         Original version by ??
  8.                         Modified by S. E. Kohn
  9.                             Aug, 1993
  10.  
  11.     Files in CDPATH12.ZIP:
  12.  
  13.             READ.ME       This file.
  14.             CDPATH.COM    Program to generate CDPATH environmental variable.
  15.             CDPATH.C      Source code for CDPATH.COM
  16.             KCD.COM       Directory changer program
  17.             KCD.C         Microsoft C 6.0 source code for CD.COM.  
  18.             FILE_ID.DIZ   Description file for BBS listings
  19.  
  20.  
  21. INTRODUCTION
  22. ============
  23.  
  24.     CDPATH.COM is a program to generate the CDPATH environmental variable 
  25. used by the 4DOS CD commmand.  In addition, program KCD.COM is a replacement
  26. for the internal 4DOS CD command that allows changing to directories with 
  27. only a partial name specified (i.e., directory name completion).
  28.  
  29.  
  30.  
  31.     A directory change program (CD) should have a number of features:
  32.  
  33.           1.  The ability to find the target directory, even if it is part
  34.               of a different branch of the directory tree, without having 
  35.               to specifying a detailed path.  For example, to go from 
  36.               directory "c:\samples\foo" to "c:\test\red\bar" by simply 
  37.               entering "cd bar"
  38.  
  39.           2.  The ability to find a target directory on another drive.
  40.  
  41.           3.  Name completion.  The ability to find a target directory with 
  42.               only the first part of the name specified.  For example,
  43.               specifying "cd exam" to go to directory "examples".  
  44.     
  45.  
  46.     With the introduction of 4DOS 4.0, the environmental variable CDPATH 
  47. was introduced as a fast way to navigate the file directory tree.  CDPATH 
  48. is a list of directories (in the same format as the standard PATH variable)
  49. which are to be searched.  The internal 4DOS CD command searches the 
  50. directories specified in CDPATH to see if the desired target directory is
  51. either one of those, or a sub-directory of them.  For example, if CDPATH
  52. were set to 
  53.  
  54.         set CDPATH=c:\;c:\dos;c:\bin;c:\windows
  55.  
  56. then the command  "CD FOO"   would first search for "FOO" as a directory in 
  57. the CDPATH variable and then search for 
  58.  
  59.         c:\foo
  60.         c:\dos\foo
  61.         c:\bin\foo    
  62.         c:\windows\foo
  63.  
  64. in that order.  The search stops when the first directory match is found.  
  65. This is a fast and efficient way of finding a directory.  It works well 
  66. across different drives, including floppies.  
  67.  
  68.     However, there are two limitations to this method.  First, it lacks 
  69. directory name completion capability.  Secondly, environmental variables,
  70. including CDPATH, are limited to 255 characters (actually less, since the
  71. 255 limit includes the "SET CDPATH=").  That is the limit for 4DOS.  For
  72. those too foolish to use 4DOS the limit is 127 characters.
  73.  
  74.     I created the program CDPATH.COM to automatically generate the 
  75. environmental variable CDPATH needed for the 4DOS CD command.  To allow 
  76. searching longer CDPATH's, program CDPATH.COM will generate environmental 
  77. variables CDPATH, CDPATH1, CDPATH2, etc.  These can be used with the KCD.COM 
  78. program included.
  79.  
  80.     There are a number of programs on the Shareware market that are fast 
  81. directory changers.  The good ones (such as Kieth Ledbetter's LCD) have 
  82. the very desirable feature of directory name completion.  Programs like LCD 
  83. use an index file to maintain a list of all files on disc.  However, every 
  84. time a directory is added or deleted, the index file must be updated.  This 
  85. method works well for hard discs, but not for floppies.  Also, occasionally
  86. automated software installation programs will have trouble because it creates 
  87. a new directory that LCD won't recognize.  The internal 4DOS CD command is 
  88. not as sensitive, since it needs only the root directories to be specified 
  89. in CDPATH.  
  90.  
  91.  
  92.  
  93. KCD
  94. ===
  95.  
  96.     Recently, I downloaded from CI$ the source code for a change directory 
  97. program that works with the 4DOS environmental variable CDPATH.  The original 
  98. program is a simple, efficient implementation of the internal 4DOS CD command.
  99. By making a few small changes, I was able to add:
  100.  
  101.       1. Directory name completion ability.
  102.  
  103.       2. Sequential search of CDPATH, CDPATH1, CDPATH2, to allow an
  104.          unlimited number of directory roots to be searched.
  105.  
  106.       3. A few error corrections in the original (LINT works wonders!).  
  107.  
  108.     The executable program was compiled with Microsoft C 6.0.
  109.  
  110.     To use this program, or the internal 4DOS CD command, an environmental 
  111. variable called CDPATH must be created.  The commands to generate CDPATH 
  112. will be created by the program CDPATH.COM described below.  The SET commands 
  113. for the environmental variables CDPATH, CDPATH1, etc. are customarily placed 
  114. in the AUTOEXEC.BAT file.  Then they will be created automatically each time 
  115. the computer is booted up.
  116.  
  117. Then create an alias for CD
  118.  
  119.      alias cd `<path>\kcd.com`
  120.  
  121.     The internal 4DOS CD command also has the option of flipping the current
  122. directory with the last previous directory by specifying "CD -".  To 
  123. add this feature with KCD.COM, it is necessary to set an environmental
  124. variable, LASTDIR with the name of the previous directory.  This
  125. can be done with the following alias
  126.  
  127. alias cd `set l$$=%_cwd^<path>\kcd %1^set lastdir=l$$^unset l$$`
  128.  
  129. where "<path>" is the directory path containing program KCD.COM.  My experience
  130. is that this is a very fast and reliable directory changer.  It has the 
  131. advantages of then internal 4DOS CD command plus directory name completion 
  132. and unlimited effective length of CDPATH.  Compared to index file directory 
  133. changers such as LCD, it works better with floppies and installation software.
  134.  
  135.    An additional alias for moving up the directory tree to use is
  136.  
  137. alias .*...... `cd .%0`
  138.  
  139. This will move up the directory chain the number of levels equal to the
  140. number of '.'s entered, i.e.  '...' will move up three levels in the 
  141. directory chain.
  142.  
  143.  
  144. CDPATH
  145. ======
  146.  
  147.     To generate the environmental variable CDPATH, I have written the
  148. short program CDPATH.  This will search through the specified drives to
  149. find all directories that should be listed in CDPATH.  To use this 
  150. program 
  151.  
  152.        CDPATH <file name> <drive letter> [<drive letter> ...]
  153.  
  154. This will write the command to generate CDPATH to the file specified by 
  155. <file name>.  If more than 255 characters are needed, for CDPATH, the
  156. program will automatically create CDPATH1, CDPATH2, etc. as needed.
  157. For example, to search drives C D and E,
  158.  
  159.        CDPATH test.bat C D E
  160.  
  161. This will write the command lines necessary to generate CDPATH to file
  162. TEST.BAT.  It is strongly recommended that you edit the SET CDPATH command in
  163. the file test.bat to put most frequently accessed directories first, and to 
  164. delete unnecessary directories.
  165.  
  166.     After you have edited the command line for CDPATH, add it to your 
  167. AUTOEXEC.BAT file.
  168.  
  169.     Since the original source code was freeware, I consider my modifications
  170. to KCD.C to also to be freeware.  Program CDPATH.C is also released as 
  171. freeware.  I make no warranties as to their accuracy and accept no 
  172. responsibility for any damage they may cause.
  173.  
  174.     I would be interested in hearing opinions on this program.  Leave mail at 
  175. CI$ for user 70031,1004.  I would be very interested in hearing from the 
  176. original program author.
  177.  
  178.  
  179.                                     Stanley E. Kohn
  180.                                     Nov 15, 1992
  181.  
  182.  
  183.  
  184. Version History
  185. ===============
  186.  
  187. March 20, 1992    Version 1.0 
  188.     Initial version.
  189.  
  190. Nov 11, 1992      Version 1.1.  
  191.     CDPATH now orders directories alphabetically.
  192.     CD now properly handles 'cd ...' when more than two periods are 
  193.     specified.
  194.  
  195.  
  196.  
  197.  
  198.